public class FanZhuan {
    public static void main(String[] args) {
        int result = reverse(12345);
        System.out.println(result);
    }
    public static int reverse(int x){
        int res=0;
        while (x != 0) {
            res = res*10+x%10; // 参照判断回文数
            x/=10;
        }
        return res;
    }
}
